package com.hodgepodge.commons.base.entity;

import com.hodgepodge.commons.validator.group.Query;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;

/**
 * title PageInfo
 * projectName colorful-blog
 * desc 分页实体类
 *
 * @author jiangjian
 * @date 2021/6/1 15:22
 */
@Data
@ApiModel(description = "分页")
public class PageInfo<T> {

    /**
     * 当前页
     */
    @ApiModelProperty(value = "当前页")
    @Min(value = 1, message = "当前页不能为空且不能小于1", groups = Query.class)
    private int currentPage;

    /**
     * 每页显示条数
     */
    @ApiModelProperty(value = "每页显示条数")
    @Min(value = 1, message = "每页显示条数不能为空且不能小于1", groups = Query.class)
    private int pageSize;

    /**
     * 条件对象
     */
    @ApiModelProperty(value = "条件对象")
    private T condition;

}
